package cn.hanyx.coder.design.pattern.structural.composite.demo01;

/**
 * Employee
 *
 * @author hanyx
 * @date 2020/08/21
 */
public class Employee extends HumanResource {

    private double salary;

    public Employee(long id, double salary) {
        super(id);
        this.salary = salary;
    }

    @Override
    public double calculateSalary() {
        return salary;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", salary=" + salary +
                '}';
    }
}
